package com.wenhai.concurrency.lock;

import java.util.concurrent.locks.LockSupport;

/**
 * @ClassName LockSupportDemo
 * @Description {@link LockSupport} 示例
 * @Author 谢文海
 * @Date 2021/4/15 0:52
 * @Version 1.0
 **/
public class LockSupportDemo {
    public static void main(String[] args) {
        LockSupport.unpark(Thread.currentThread());
        System.out.println("begin park!");
        // 会被阻塞，默认情况下调用线程是不持有许可证
        LockSupport.park();
        System.out.println("end park!");
    }
}
